/**
 * 
 */
package com.littleken.demo.dto;

import com.fasterxml.jackson.annotation.JsonView;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Past;
import java.util.Date;


//import io.swagger.annotations.ApiModelProperty;

/**
 *用户dto
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class User {

	public interface UserSimpleView {};//简单视图，不展示密码
	public interface UserDetailView extends UserSimpleView {};//展示密码

	@JsonView(UserSimpleView.class)//简单视图，不展示密码
	private String id;

	@JsonView(UserSimpleView.class)
	private String username;

	@NotBlank(message = "密码不能为空")
	@JsonView(UserDetailView.class)//展示密码
	private String password;

	@Past(message = "生日必须是过去的时间")
	@JsonView(UserSimpleView.class)
	private Date birthday;

}
